package com.hy;

public class TriangleDemo {

    public double triangleArea(double a, double b, double c) {
        double p = (a + b + c) / 2.0;
        double s = Math.sqrt(p * (p - a) * (p - b) * (p - c));
        return s;
    }

    public double trianglePerimeter(double a, double b, double c) {
        return a + b + c;
    }

    public boolean testTrue(double a, double b, double c) {
        if (a + b > c && a + c > b && b + c > a) {
            return true;
        } else {
            System.out.println("无法构成三角形");
            return false;
        }

    }
}
